#!/bin/bash

if [ ! -d "./elasticsearch/config" ]; then
  mkdir ./elasticsearch/config
  cp -r elasticsearch-config/* ./elasticsearch/config
fi

if [ ! -d "./elasticsearch/config01" ]; then
  mkdir ./elasticsearch/config01
  cp -r elasticsearch-config01/* ./elasticsearch/config01
fi

if [ ! -d "./elasticsearch/config02" ]; then
  mkdir ./elasticsearch/config02
  cp -r elasticsearch-config02/* ./elasticsearch/config02
fi

if [ ! -d "./elasticsearch/config03" ]; then
  mkdir ./elasticsearch/config03
  cp -r elasticsearch-config03/* ./elasticsearch/config03
fi

if [ ! -d "./elasticsearch/data" ]; then
  mkdir ./elasticsearch/data
  chmod -R 777 ./elasticsearch/data
fi

if [ ! -d "./elasticsearch/data01" ]; then
  mkdir ./elasticsearch/data01
  chmod -R 777 ./elasticsearch/data01
fi

if [ ! -d "./elasticsearch/data02" ]; then
  mkdir ./elasticsearch/data02
  chmod -R 777 ./elasticsearch/data02
fi

if [ ! -d "./elasticsearch/data03" ]; then
  mkdir ./elasticsearch/data03
  chmod -R 777 ./elasticsearch/data03
fi

if [ ! -d "./kibana/config" ]; then
  mkdir ./kibana/config
  cp -r ./kibana-config/* ./kibana/config
fi

if [ ! -d "./kibana/config-cluster" ]; then
  mkdir ./kibana/config-cluster
  cp -r ./kibana-config-cluster/* ./kibana/config-cluster
fi

cp .env.example .env
